package main

import "fmt"

func main() {
	/// if
	if number := 10; number%2 == 0 {
		fmt.Println(number, "is even")
	} else {
		fmt.Println(number, "is odd")
	}

	/// for
	// 标准的for循环
	for i := 0; i < 5; i++ {
		fmt.Println("Value of i is:", i)
	}

	// 类似while的for循环
	sum := 1
	for sum < 1000 {
		sum += sum
	}
	fmt.Println("Sum is:", sum)

	/// switch
	dayOfWeek := 3
	switch dayOfWeek {
	case 1:
		fmt.Println("Monday")
	case 2:
		fmt.Println("Tuesday")
	case 3:
		fmt.Println("Wednesday")
		// ...
	default:
		fmt.Println("Invalid day")
	}
}
